module.exports = (err, ctx) => {
  let status = 500;
  switch (err.code) {
    case "1001":
      status = 400;
      break;
    case "1002":
      status = 401;
      break;
    default:
      status = 500;
      break;
  }
  ctx.status=status;
  ctx.body=err
};
